home *** CD-ROM | disk | FTP | other *** search
- /*
- */
- bufferflush;options results;path="RAM:";signal on ioerr;signal on error;signal on syntax
- wtim=10;ltim=-10
- main0:
- transmit "z5c3 -+- Code Breaker! v1.0 -+- z0"
- code1=random(1,9,time('s'))
- code2=random(1,9,time('s'))
- code3=random(1,9,time('s'))
- tries=0
- guess:
- tries=tries+1
- if tries>7 then do;transmit "c1Too many tries!";signal lose;end
- guess1:
- transmit "c2Guess #c7"tries
- query "c4Enter 3 digit code: c7"
- cg=result
- if left(cg,1,)="#" then signal quit
- if length(cg)<3 then do;transmit "c1Not enough Numbers!";signal guess1;end
- x1=substr(cg,1,1);x2=substr(cg,2,1);x3=substr(cg,3,1);rt=0
- codea:
- if x1=code1 then rt=rt+1
- if x2=code2 then rt=rt+1
- if x3=code3 then rt=rt+1
- transmit "c2You Guessed c3"rt"c2 Number(s) right!"
- if rt=3 then do;transmit "z7c4 You Guessed the number! z0";signal win;end
- signal guess
-
- win:
- Transmit "n1c3You won "wtim" Minutes!"
- addtime wtim
- exit
-
- lose:
- transmit "n1c3You lost "ltim" Minutes!n1"
- transmit "c5the Number wasc7 "code1 code2 code3
- addtime ltim
- exit
-
- quit:
- exit
-
- ioerr:
- syntax:
- error:
- transmit "Error on line "sigl
- exit
-